package ex.com

import org.codehaus.groovy.grails.commons.ApplicationHolder;
import org.springframework.context.ApplicationContext;

class ProductService {

    static transactional = true

	def grailsApplication
	
    def execute() {
		def b = grailsApplication.getMainContext().getBean("m1Service")
		b.send()
		
		ApplicationContext ctx = (ApplicationContext)ApplicationHolder.getApplication().getMainContext();
		def service =  ctx."${'m1Service'}"
		service.send()
		
		
//		def mailService = grailsApplication.getParentContext().getBean("m1Service")
//		mailService.send()
    }
}
